#include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;

int main() { // t1p01: identifier
  auto f = [](char c) { return isalnum(c) || c == '_'; };
  for(string s; getline(cin, s);) {
    cout << (!s.empty() && !isdigit(s[0]) && all_of(s.begin(), s.end(), f)) << '\n';
  }
}